package homework917;

public class ReplaceAllDemo {
    public static void main(String[] args) {
        String str = "abc123de456hi";

        str =str.replaceAll("[0-9]+","#NUMBER#");
        System.out.println(str);

        //和谐用语
        String regex = "(gun|sha|sb)";
        String message = "你sb吧，gun吧！";
        message = message.replaceAll(regex,"***");
        System.out.println(message);
    }
}
